package com.higgins.lawapp.client.settings.components;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;

public class DataSourceElementFields extends DataSourceComponent	{
	private final Label label = new Label();
    private final TextBox start = new TextBox();
    private final TextBox end = new TextBox();

    public DataSourceElementFields(String startText, String endText)	{
    	instantiate();
    	start.setText(startText);
    	end.setText(endText);
    }
    public DataSourceElementFields()	{
    	instantiate();
    }
    public void instantiate()	{
		this.setComponentType("Element");
	    label.setText("Element");
	    start.setTitle("Element Start");
	    end.setTitle("Element End");
	    start.setText("");
	    end.setText("");
	    add(label);
	    add(start);
	    add(end);
	    setWidgetLeftWidth(label, 0, Unit.PCT, 33, Unit.PCT);
	    setWidgetLeftWidth(start, 33, Unit.PCT, 33, Unit.PCT);
	    setWidgetRightWidth(end, 1, Unit.PCT, 33, Unit.PCT);
	}
    
    public String getStart()	{
    	return start.getText();
    }
    public  String getEnd()	{
    	return end.getText();
    }
}
